package com.zwp.base.state

import android.util.Log
import android.view.View
import androidx.constraintlayout.widget.ConstraintLayout


class DefaultStateContainerProcessor(val rootView: ConstraintLayout) : IStateContainerProcessor {

    override fun addStateModelView(stateModelView: View) {
        val layoutParams = ConstraintLayout.LayoutParams(0, 0)
        layoutParams.leftToLeft = ConstraintLayout.LayoutParams.PARENT_ID
        layoutParams.rightToRight = ConstraintLayout.LayoutParams.PARENT_ID
        layoutParams.topToTop = ConstraintLayout.LayoutParams.PARENT_ID
        layoutParams.bottomToBottom = ConstraintLayout.LayoutParams.PARENT_ID
        rootView.addView(stateModelView, layoutParams)
    }

    override fun removeStateModelView(stateModelView: View) {
        rootView.removeView(stateModelView)
    }
}